﻿<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="CPMLSchema" targetNamespace="http://schemas.microsoft.com/dsltools/CPML" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/dsltools/CPML" xmlns:core="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:import id="CoreSchema" namespace="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" />
  <!-- PageModelPackage -->
  <xsd:element name="pageModelPackage" type="PageModelPackage" substitutionGroup="core:modelElement" />
  <xsd:complexType name="PageModelPackage">
    <xsd:annotation>
      <xsd:documentation>The root in which all other elements are embedded. Appears as a diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: PageModelPackageHasPageModels -->
          <xsd:element name="pageModels" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of PageModelPackageHasPageModels</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:choice minOccurs="0" maxOccurs="unbounded" >
                  <xsd:element ref="pageModelPackageHasPageModels">
                    <xsd:annotation>
                      <xsd:documentation>[Relationship deriving from PageModelPackageHasPageModels needs to be serialized in full-form]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                  <xsd:element ref="pageModel" >
                    <xsd:annotation>
                      <xsd:documentation>[Target role-player]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                </xsd:choice>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <!-- Relationship: PageModelPackageHasCPMLAttribute -->
          <xsd:element name="cPMLAttribute" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of PageModelPackageHasCPMLAttribute</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="pageModelPackageHasCPMLAttribute" minOccurs="0" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation>[Instance of PageModelPackageHasCPMLAttribute needs to be serialized in full-form]</xsd:documentation>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- dslVersion -->
        <xsd:attribute name="dslVersion" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Version of the model serialized in this file.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelPackage Moniker -->
  <xsd:element name="pageModelPackageMoniker" type="PageModelPackageMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="PageModelPackageMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for PageModelPackage instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModel -->
  <xsd:element name="pageModel" type="PageModel" substitutionGroup="core:modelElement" />
  <xsd:complexType name="PageModel">
    <xsd:annotation>
      <xsd:documentation>Elements embedded in the model. Appear as boxes on the diagram.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Relationship: PageModelReferencesChildren -->
          <xsd:element name="children" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of PageModelReferencesChildren</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:choice minOccurs="0" maxOccurs="unbounded" >
                  <xsd:element ref="pageModelReferencesChildren">
                    <xsd:annotation>
                      <xsd:documentation>[Relationship deriving from PageModelReferencesChildren needs to be serialized in full-form]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                  <xsd:element ref="pageModelMoniker" >
                    <xsd:annotation>
                      <xsd:documentation>[Target role-player]</xsd:documentation>
                    </xsd:annotation>
                  </xsd:element>
                </xsd:choice>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <!-- Relationship: PageModelReferencesAttributes -->
          <xsd:element name="attributes" minOccurs="0" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>Instances of PageModelReferencesAttributes</xsd:documentation>
            </xsd:annotation>
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element ref="pageModelReferencesAttributes" minOccurs="0" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation>[Instance of PageModelReferencesAttributes needs to be serialized in full-form]</xsd:documentation>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: InternalName -->
        <xsd:attribute name="internalName" type="xsd:string" />
        <!-- Property: DisplayName -->
        <xsd:attribute name="displayName" type="xsd:string" />
        <!-- Property: Description -->
        <xsd:attribute name="description" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModel Moniker -->
  <xsd:element name="pageModelMoniker" type="PageModelMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="PageModelMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for PageModel instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- CPMLAttribute -->
  <xsd:element name="cPMLAttribute" type="CPMLAttribute" substitutionGroup="core:modelElement" />
  <xsd:complexType name="CPMLAttribute">
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <!-- Property: InternalName -->
        <xsd:attribute name="internalName" type="xsd:string" />
        <!-- Property: DisplayName -->
        <xsd:attribute name="displayName" type="xsd:string" />
        <!-- Property: Required -->
        <xsd:attribute name="required" type="xsd:boolean" />
        <!-- Property: Type -->
        <xsd:attribute name="type" type="AttributeType" />
        <!-- Property: Description -->
        <xsd:attribute name="description" type="xsd:string" />
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- CPMLAttribute Moniker -->
  <xsd:element name="cPMLAttributeMoniker" type="CPMLAttributeMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="CPMLAttributeMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for CPMLAttribute instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelPackageHasPageModels -->
  <xsd:element name="pageModelPackageHasPageModels" abstract="true" type="PageModelPackageHasPageModels" substitutionGroup="core:modelElement" />
  <xsd:complexType name="PageModelPackageHasPageModels" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Embedding relationship between the Model and Elements</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end PageModel -->
          <xsd:element ref="pageModel" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelPackageHasPageModels Moniker -->
  <xsd:element name="pageModelPackageHasPageModelsMoniker" type="PageModelPackageHasPageModelsMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="PageModelPackageHasPageModelsMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for PageModelPackageHasPageModels instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelReferencesChildren -->
  <xsd:element name="pageModelReferencesChildren" abstract="true" type="PageModelReferencesChildren" substitutionGroup="core:modelElement" />
  <xsd:complexType name="PageModelReferencesChildren" abstract="true" >
    <xsd:annotation>
      <xsd:documentation>Reference relationship between Elements.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end PageModel -->
          <xsd:element ref="pageModelMoniker" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelReferencesChildren Moniker -->
  <xsd:element name="pageModelReferencesChildrenMoniker" type="PageModelReferencesChildrenMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="PageModelReferencesChildrenMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for PageModelReferencesChildren instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelReferencesAttributes -->
  <xsd:element name="pageModelReferencesAttributes" type="PageModelReferencesAttributes" substitutionGroup="core:modelElement" />
  <xsd:complexType name="PageModelReferencesAttributes">
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end CPMLAttribute -->
          <xsd:element ref="cPMLAttributeMoniker" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelReferencesAttributes Moniker -->
  <xsd:element name="pageModelReferencesAttributesMoniker" type="PageModelReferencesAttributesMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="PageModelReferencesAttributesMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for PageModelReferencesAttributes instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelPackageHasCPMLAttribute -->
  <xsd:element name="pageModelPackageHasCPMLAttribute" type="PageModelPackageHasCPMLAttribute" substitutionGroup="core:modelElement" />
  <xsd:complexType name="PageModelPackageHasCPMLAttribute">
    <xsd:complexContent>
      <xsd:extension base="core:ModelElement">
        <xsd:sequence minOccurs="0" maxOccurs="1">
          <!-- Target end CPMLAttribute -->
          <xsd:element ref="cPMLAttribute" minOccurs="1" maxOccurs="1">
            <xsd:annotation>
              <xsd:documentation>[Target role-player]</xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
        <!-- Id -->
        <xsd:attribute name="Id" type="xsd:string">
          <xsd:annotation>
            <xsd:documentation>Instance Guid of this element, needed because SerializeId is set to true.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- PageModelPackageHasCPMLAttribute Moniker -->
  <xsd:element name="pageModelPackageHasCPMLAttributeMoniker" type="PageModelPackageHasCPMLAttributeMoniker" substitutionGroup="core:modelElementMoniker" />
  <xsd:complexType name="PageModelPackageHasCPMLAttributeMoniker">
    <xsd:annotation>
      <xsd:documentation>Moniker for PageModelPackageHasCPMLAttribute instance.</xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="core:ModelElementMoniker">
        <xsd:attribute name="Id" type="xsd:string" >
          <xsd:annotation>
            <xsd:documentation>Attribute to store the moniker string.</xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  
  <!-- Enum AttributeType -->
  <xsd:simpleType name="AttributeType">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="HTMLEditorRich"/>
      <xsd:enumeration value="HTMLEditorSimple"/>
      <xsd:enumeration value="TextBox"/>
      <xsd:enumeration value="TextLine"/>
      <xsd:enumeration value="DropdownSingleChoice"/>
      <xsd:enumeration value="DropdownMultipleChoice"/>
      <xsd:enumeration value="CheckBoxes"/>
      <xsd:enumeration value="RadioButtons"/>
      <xsd:enumeration value="Date"/>
      <xsd:enumeration value="DateTime"/>
      <xsd:enumeration value="Image"/>
      <xsd:enumeration value="Number"/>
      <xsd:enumeration value="Boolean"/>
    </xsd:restriction>
  </xsd:simpleType>
  
</xsd:schema>

